#! /usr/bin/python3

import json

import requests

if __name__ == '__main__':
    
    username = "jin1213107752"
    
    url = f"https://gitee.com/api/v5/users/{username}/repos"
    header = {
        "Content-Type": "application/json;charset=UTF-8"
    }
    
    response = requests.get(
        url=url,
        headers=header,
    )
    
    print("Response code:", response.status_code)
    if response.status_code == 200:
        data_list = json.loads(response.text)
        print(len(data_list))
        # print(data_dict)
        for i in range(len(data_list)):
            item = data_list[i]
            print(i + 1, item["created_at"], item["name"], item["html_url"])
    
    else:
        print(response.text)
